package com.iretailer.quartz.common;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Map;

/**
 * Created by xjw
 */
@TableName(value = "task")
public class Task {
    //id
    @TableId(type = IdType.ID_WORKER_STR)
    private String id;
    //任务名称
    private String jobName;
    //分组
    private String jobGroup;
    /**
     * 任务初始状态 0禁用 1启用 2删除
     */
    private Integer status;
    //运行时间表达式
    private String cron;
    //注册的 bean id
    private String springId;
    private String concurrent;
    //
    private String clazzName;

    private String methodName;

    private String description;

    private String otherMessage;

    @TableField(exist = false)
    private Map<String, Object> messageMap;

    public Task() {
    }

    public Task(String springId) {
        this.springId = springId;
    }

    public Task(String id, Integer status) {
        this.id = id;
        this.status = status;
    }

    public Task(String  id, String cron, String otherMessage) {
        this.id = id;
        this.cron = cron;
        this.otherMessage = otherMessage;
    }

    public Map<String, Object> getMessageMap() {
        return messageMap;
    }

    public void setMessageMap(Map<String, Object> messageMap) {
        this.messageMap = messageMap;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobGroup() {
        return jobGroup;
    }

    public void setJobGroup(String jobGroup) {
        this.jobGroup = jobGroup;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getCron() {
        return cron;
    }

    public void setCron(String cron) {
        this.cron = cron;
    }

    public String getSpringId() {
        return springId;
    }

    public void setSpringId(String springId) {
        this.springId = springId;
    }

    public String getConcurrent() {
        return concurrent;
    }

    public void setConcurrent(String concurrent) {
        this.concurrent = concurrent;
    }

    public String getClazzName() {
        return clazzName;
    }

    public void setClazzName(String clazzName) {
        this.clazzName = clazzName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getOtherMessage() {
        return otherMessage;
    }

    public void setOtherMessage(String otherMessage) {
        this.otherMessage = otherMessage;
    }
}
